package flags

import "time"

var (
	FlagAppName        = flag{"name", "n", "go-scaffold", "set the application name"}
	FlagAppEnvironment = flag{"env", "e", "dev", "set the application environment (dev, test, prod)"}

	FlagConfig = flag{"config", "f", "./etc/config.yaml", "configuration file path"}

	FlagRemoteConfigEnable     = flag{"config.remote.enable", "", false, "enable remote config"}
	FlagRemoteConfigEndpoints  = flag{"config.remote.endpoints", "", []string{"http://localhost:2379"}, "remote config endpoint"}
	FlagRemoteConfigTimeout    = flag{"config.remote.timeout", "", time.Second * 3, "remote config timeout"}
	FlagRemoteConfigPathPrefix = flag{"config.remote.path-prefix", "", "/go-scaffold/etc", "remote config path prefix"}

	FlagLoggerPath   = flag{"log.path", "", "logs/%Y%m%d.log", "log output path"}
	FlagLoggerLevel  = flag{"log.level", "", "info", "log level (debug, info, warn, error)"}
	FlagLoggerFormat = flag{"log.format", "", "json", "log output format (text, json)"}

	FlagMigrationDir           = flag{"migration", "m", "migrations", "migration directory"}
	FlagMigrationDBGroup       = flag{"db-group", "", "default", "migration database group"}
	FlagMigrationIgnoreUnknown = flag{"ignore-unknown", "", false, "whether to skip checking the database for migrations that are not in the migration source"}

	FlagServerTypes = flag{"servers", "s", []string{"http", "grpc"}, "server types (http, grpc)"}
)

type flag struct {
	Name         string
	ShortName    string
	DefaultValue interface{}
	Usage        string
}
